package com.ecoolex.ying.space.ws;

import java.util.List;

import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import com.ecoolex.framework.common.exception.BizException;
import com.ecoolex.framework.common.pojo.Page;
import com.ecoolex.framework.common.pojo.Pagination;
import com.ecoolex.framework.common.pojo.Sorting;
import com.ecoolex.ying.space.core.manager.EstateProjectActivityGoodsOrderCustomerManager;
import com.ecoolex.ying.space.core.manager.EstateProjectActivityGoodsOrderDetailManager;
import com.ecoolex.ying.space.core.manager.EstateProjectActivityGoodsOrderManager;
import com.ecoolex.ying.space.core.manager.EstateProjectActivityGoodsOrderRefundAuditManager;
import com.ecoolex.ying.space.entity.EstateProjectActivityGoodsOrder;
import com.ecoolex.ying.space.entity.EstateProjectActivityGoodsOrderCustomer;
import com.ecoolex.ying.space.entity.EstateProjectActivityGoodsOrderDetail;
import com.ecoolex.ying.space.entity.EstateProjectActivityGoodsOrderRefundAudit;
import com.ecoolex.ying.space.pojo.SubmitEstateProjectActivityGoodsOrderDTO;
import com.ecoolex.ying.space.pojo.UpdateEstateProjectActivityGoodsOrderCustomerDTO;

@Service
public class EstateProjectActivityGoodsOrderServiceImpl implements EstateProjectActivityGoodsOrderService{

	@Autowired
	private EstateProjectActivityGoodsOrderManager orderManager;
	
	@Override
	public EstateProjectActivityGoodsOrder submit(SubmitEstateProjectActivityGoodsOrderDTO submit, String createUser) {
		return orderManager.submit(submit, createUser);
	}

	@Override
	public Pagination<EstateProjectActivityGoodsOrder> queryByOperationUserId(Integer status, Integer operationUserId, Page page) {
		return orderManager.queryByOperationUserId(status, operationUserId, page);
	}

	@Override
	public EstateProjectActivityGoodsOrder getByOperationUserId(Integer orderId, Integer operationUserId) {
		return orderManager.getByOperationUserId(orderId, operationUserId);
	}

	@Override
	public Pagination<EstateProjectActivityGoodsOrder> query(Integer status, Sorting[] sorts, Page page) {
		return orderManager.query(status, sorts, page);
	}

	@Override
	public EstateProjectActivityGoodsOrder get(Integer orderId) {
		return orderManager.get(orderId);
	}
	
	@Override
	public EstateProjectActivityGoodsOrder get(String orderNo) {
		return orderManager.get(orderNo);
	}

	@Override
	public void refundApply(EstateProjectActivityGoodsOrder record,String updateUser) {
		orderManager.refundApply(record,updateUser);
	}
	
	@Autowired
	private EstateProjectActivityGoodsOrderDetailManager detailManager;

	@Override
	public List<EstateProjectActivityGoodsOrderDetail> detailList(Integer orderId) {
		return detailManager.detailList(orderId);
	}
	
	@Autowired
	private EstateProjectActivityGoodsOrderCustomerManager customerManager;

	@Override
	public EstateProjectActivityGoodsOrderCustomer addCustomer(EstateProjectActivityGoodsOrderCustomer record, String createUser) {
		return customerManager.addCustomer(record, createUser);
	}

	@Override
	public EstateProjectActivityGoodsOrderCustomer editCustomer(EstateProjectActivityGoodsOrderCustomer record, String updateUser) {
		return customerManager.editCustomer(record, updateUser);
	}
	
	@Override
	public EstateProjectActivityGoodsOrderCustomer updateCustomer(UpdateEstateProjectActivityGoodsOrderCustomerDTO record, String updateUser) throws BizException {
		return customerManager.updateCustomer(record, updateUser);
	}

	@Override
	public EstateProjectActivityGoodsOrderCustomer getCustomer(Integer id) {
		return customerManager.getCustomer(id);
	}

	@Override
	public EstateProjectActivityGoodsOrderCustomer getCustomerByOrderId(Integer orderId) {
		return customerManager.getByOrderId(orderId);
	}

	@Override
	public void cancelOrder(EstateProjectActivityGoodsOrder record,String updateUser) throws BizException {
		orderManager.cancelOrder(record, updateUser);
	}
	
	@Autowired
	private EstateProjectActivityGoodsOrderRefundAuditManager auditManager;

	@Override
	public EstateProjectActivityGoodsOrderRefundAudit getRefundAudit(Integer auditId) {
		return auditManager.get(auditId);
	}

	@Override
	public Pagination<EstateProjectActivityGoodsOrderRefundAudit> queryRefundAudit(Integer status, Sorting[] sorts, Page page) {
		return auditManager.query(status, sorts, page);
	}

	@Override
	public void auditPassed(Integer auditId, String remark, Integer auditUserId, String updateUser) throws BizException {
		auditManager.auditPassed(auditId, remark, auditUserId, updateUser);
	}

	@Override
	public void auditRefused(Integer auditId, String remark, Integer auditUserId, String updateUser) throws BizException {
		auditManager.auditRefused(auditId, remark, auditUserId, updateUser);
	}

}
